<template>
	<div class="mobile_orders">
		<div class="Myorder_nav">
			<div class="Myorder_option1"><button><router-link to="/mobile/user">返回</router-link> </button></div>
			<div class="Myorder_option2"><input placeholder="搜索我的订单" /></div>
		</div>
		<div class="Myorder_order" >
			
			<div v-for=" item in list">
				<div style="display: flex; background-color: white;width: 90%;border-radius: 10px;" >
						<img style="width: 30%;" :src="`http://127.0.0.1/api/public/showimg/${item.book.pic}`"/>
					<div>
						<div>{{item.book.name}}</div>
						<div>x{{item.num}}</div>
						<div>共支付￥{{item.price}}</div>
					</div>
					<div>
						
					</div>
				</div>
				<div style="height: 10%;">l</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		name: '',
		data() {
			return {
				order: {
					days: '120',
					payStaus: '',
					shipStatus: '',
					phone: '',
					account: 'tom',
					nickname: ''
				},
				list: []
			}
		},
		methods: {

			fun() {
				let o = window.localStorage.getItem("account");
				this.order.account = o
				console.log(o)
				console.log(this.order)
				this.$postf("/api/adm/ord/findPageOrders2u/1/6", this.order).then((resp) => {
					resp.data.data.orders.forEach((item) => {
						if (item.items.length > 0) {
							item.items.forEach((u) => {
								console.log(u)
								this.list.push(u)
							})
						}

					})
					console.log(this.list)
				})

			}

		},
		mounted() {
			this.fun()
		}
	}
</script>

<style>
	.mobile_orders {
		background-color: #99A9BF;
		margin: 0;
		padding: 0;
		width: 100%;
	}

	.Myorder_nav {
		width: 100%;
		margin-top: 5%;
		display: flex;
	}
	.Myorder_order{
		margin: 10px auto;
		margin-left: 10%;
	}

	.Myorder_option1 {
		margin-left: 10%;
	}

	.Myorder_option2 {
		margin-left: 10%;
	}
</style>
